<?php
/**
 * 栈输出相关
 */
require 'StackByLinkedList.php';
$stack = new StackByLinkedList();

$stack->push('aa');
$stack->push('bb');
$stack->push('cc');
$stack->push('dd');
$stack->push('ee');
$stack->push('ff');
$stack->push('gg');
$stack->push('hh');

echo $stack->peek(); //查看栈顶元素，打印 hh
echo "<br>";
echo $stack->toString(); //打印栈数据 hh->gg->ff->ee->dd->cc->bb->aa->null

echo "<br>";
echo $stack->pop();  //出栈，打印 hh
echo "<br>";
echo $stack->toString(); //打印栈数据 gg->ff->ee->dd->cc->bb->aa->null






